package com.edu.app.service.impl.core;

import com.edu.app.bean.core.SysContact;
import com.edu.app.bean.linkbeans.SysAccountContact;

import com.edu.app.mapper.core.SysContactMapper;
import com.edu.app.mapper.linkmappers.SysAccountContactMapper;
import com.edu.app.service.impl.SysBaseServiceImpl;
import com.edu.app.service.sys.core.SysContactService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysContactServiceImpl extends SysBaseServiceImpl<SysContact,SysContactMapper> implements SysContactService {
    @Autowired
    SysContactMapper sysContactMapper;

    @Autowired
    SysAccountContactMapper sysAccountContactMapper;

    @Override
    public Integer add(SysContact sysOpty,Integer accountId){
        Integer contactId =  sysContactMapper.insert(sysOpty);
        SysAccountContact sysAccountContact = new SysAccountContact(accountId,contactId);
        sysAccountContactMapper.insert(sysAccountContact);
        return contactId;
    }
}
